using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace ChuyenDongVatLy
{
   
    public class MouseGame : Microsoft.Xna.Framework.GameComponent
    {
        private Texture2D _imageMouse;
        private Rectangle _recMouse;

        public Rectangle RecMouse
        {
            get { return _recMouse; }
            set { _recMouse = value; }
        }
        private Game1 game;
        public MouseGame(Game1 game)
            : base(game)
        {
            this.game = game;
            _recMouse = new Rectangle(Mouse.GetState().X, Mouse.GetState().Y, 20, 25);
            
        }

        public override void Initialize()
        {        

            base.Initialize();
        }

        public override void Update(GameTime gameTime)
        {
            _recMouse.X = Mouse.GetState().X;
            _recMouse.Y = Mouse.GetState().Y;
            base.Update(gameTime);
        }
        public bool CheckMouse(Rectangle rec)
        {
            _recMouse.X = Mouse.GetState().X;
            _recMouse.Y = Mouse.GetState().Y;
            if (_recMouse.Intersects(rec)) return true;
            return false;
        }
        public void LoadContent(ContentManager Content)
        {
            _imageMouse = Content.Load<Texture2D>("mouse");
        }
        public void Draw(SpriteBatch sp)
        {
            sp.Draw(_imageMouse, _recMouse, Color.White);            
        }
    }
}
